package com.educate.book.dao;

import java.util.List;

import org.springframework.data.domain.Page;
import org.springframework.data.domain.Pageable;
import org.springframework.data.mongodb.repository.MongoRepository;
import org.springframework.stereotype.Repository;

import com.educate.book.dao.impl.BookCatalogueDaoImpl;
import com.educate.book.model.bo.BookCatalogueBO;
import com.educate.book.model.bo.ItemBO;
import com.educate.book.model.po.Item;

@Repository
public interface ItemDao extends MongoRepository<Item, String> {

    /**
     * #{@link BookCatalogueDaoImpl#query(BookCatalogueBO, Pageable)}
     */
    Page<Item> query(ItemBO bo, Pageable pageable);
    /**
     * 查询父ID为itemId为parrentid的分类信息
     * @param parentId
     * @return
     */
    Item queryBYParentId(String parentId);
    Item queryMaxLevelItem();
    List<Item> queryItemByLevel(int level);
    public Item queryByParentIdAndName(String parentId,String name);
    
    /**
     *  查询所有父ID为parentId的列表
     * @param parentId
     * @return
     */
    public List<Item> getItemByParentId(List<String> parentIdList);
}
